# 作   者：要努力，努力，再努力
# 开发日期：2022/4/23 10:23

lst = [
    {'rating': [9, 7, 50], 'id': '1292052', 'type': ['犯罪', '剧情'], 'title': '肖申克的救赎', 'actors': ['蒂姆罗宾斯', '摩根费力曼']},
    {'rating': [9, 6, 50], 'id': '1291546', 'type': ['剧情', '爱情', '同性'], 'title': '霸王别姬',
     'actors': ['张国荣', '张丰毅', '巩俐', '葛优']},
    {'rating': [9, 6, 50], 'id': '1296141', 'type': ['犯罪', '犯罪', '悬疑'], 'title': '控方证人', 'actors': ['汤姆汉克斯', '罗宾怀特']},
]

name = input('请输入你要查询的演员')
for item in lst:  # 遍历列表   item是字典
    act_lst = item['actors']
    for actor in act_lst:
        if name == actor:
            print(name + '出演了' + item['title'])

    '''for movie in item:  # 遍历字典，得到的key
        print(movie)
    actors = movie['actors']
        if name in actors:
            print(name + '出演了：' + movie)
    '''
